{include file='pub/header'/}
<link href="__STATIC__/lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
<title>添加轮播图</title>
</head>
<body>
<div class="page-container">
    <form class="form form-horizontal" id="report" method="post" enctype="multipart/form-data">
        <!--<div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">标题：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" name="title"/>
            </div>
        </div>-->
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">图片（参考尺寸 414*180）：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <div id="fileList" class="uploader-list">
                </div>
                <div id="filePicker">选择图片</div>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">排序：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" name="ord"/>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">商品id(0则不跳转)：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" placeholder="0" name="product_id"/>
            </div>
        </div>

        <!--<div class="row cl">-->
            <!--<label class="form-label col-xs-4 col-sm-2">内容：</label>-->
            <!--<div class="formControls col-xs-8 col-sm-9">-->
                <!--<script id="editor" name="content" type="text/plain" style="width:100%;height:400px;"></script>-->
            <!--</div>-->
        <!--</div>-->
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                <button class="btn btn-secondary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存信息
                </button>
            </div>
        </div>
    </form>
</div>
{include file="pub/footer"/}
<script type="text/javascript" src="__STATIC__/lib/webuploader/0.1.5/webuploader.min.js"></script>
<!--<script type="text/javascript" src="__STATIC__/lib/ueditor/1.4.3/ueditor.config.js"></script>-->
<!--<script type="text/javascript" src="__STATIC__/lib/ueditor/1.4.3/ueditor.all.min.js"> </script>-->
<!--<script type="text/javascript" src="__STATIC__/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>-->
<script type="text/javascript" src="__STATIC__/lib/uploadImage.js"></script>

<script type="text/javascript">
    $(function () {
        // UE.getEditor('editor');
        $("#report").validate({
            onkeyup: false,
            focusCleanup: true,
            success: "valid",
            submitHandler: function (form) {
                $(form).ajaxSubmit({
                    type: 'post',
                    url: '{:url("Site/swiperAdd")}',
                    success: function (res) {
                        if (1 == res.code) {
                            layer.msg(res.msg, {icon: 6, time: 1000});
                            setTimeout(function () {
                                parent.location.reload();
                            }, 888);
                        } else {
                            layer.msg(res.msg, {icon: 5, time: 1000});
                        }
                    }
                });
            }
        });
        uploadImage($("#fileList"), null, $("form"), "image");
    });
</script>
</body>
</html>